home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / irix / playEngine / README < prev   
Encoding:
Text File  |  1994-08-02  |  2.8 KB  |  74 lines

  1.  
  2.            ~4Dgifts/toolbox/src/exampleCode/irix/playEngine README
  3.  
  4.                This file describes the purpose and use of the 
  5.              functions defined in the source file PlayEngine.c.
  6.  
  7.    OVERVIEW:
  8.    ---------
  9.        The purpose of this source file is to provide a set of routines
  10.        that will permit an audio track to be played without interference
  11.        from operating system multitasking activities.
  12.    
  13.        The way it works is to sproc (similar to fork) a sub-process that
  14.        raises its priority high enough so that the other operating system
  15.        activities cannot preempt it.  The main application provides this
  16.        new process with a pointer to the data to be played and starts and
  17.        stops the process through signals and/or semaphores.
  18.    
  19.        For more details on this implemetation, beyond what is contained in
  20.        this README, see the comments throughout the PlayEngine.c file.
  21.  
  22.    
  23.    DESCRIPTION:
  24.    ------------
  25.        This set of routines can be used for other purposes other than as
  26.        an audio player but the demo program demonstrates the functions by
  27.        playing audio tracks.
  28.    
  29.        Also, this demonstration program doesn't take full advantage of
  30.        some of the capabilities of multiprocessing.  For example, a flag
  31.        could be provided in the audio loop that would allow the parent
  32.        application to communicate commands to the child process, like to
  33.        abort early, go back some number of records, etc.
  34.    
  35.        Entry points:
  36.        -------------
  37.        CreateSubProcess
  38.            This routine is called once to create the subprocess.  If
  39.            semaphores are to be used, it will also create the semaphores.
  40.    
  41.            Synopsis:
  42.                    CreateSubProcess ();
  43.    
  44.    
  45.        StartSubProcess
  46.            This routine is called to tell the subprocess to do something.
  47.            It must be preceded by a call to 'CreateSubProcess'.  It is
  48.            called each time the subprocess is to perform some task.
  49.    
  50.            Synopsis:
  51.                    StartSubProcess ();
  52.    
  53.    
  54.        DestroySubProcess
  55.            This routine destroys the subprocess and returns the semaphore
  56.            arena to the system.  It *must* be called otherwise, the
  57.            semaphore arena is not returned to the system.
  58.    
  59.            Synopsis:
  60.                    DestroySubProcess ();
  61.    
  62.    
  63.    COMPILATION:
  64.    ------------
  65.        There are two symbols of interest when compiling the PlayEngine.
  66.        One is USE_SEMAPHORES, which will compile in code to use
  67.        semaphores between the parent and child, and the other is
  68.        DEBUG_SP, which compiles in debug print statements to allow the
  69.        developer to see what is going on as it happens.
  70.    
  71.  
  72.        Parts of the demo.c program were cut and pasted from the program
  73.        ~4Dgifts/examples/libaudio/playaifc.c.
  74.